home *** CD-ROM | disk | FTP | other *** search
-
- Sub DelNamIni ()
- 'Delete the [Name and Number] entries of old ADIALER.INI file
- lpAppName$ = "Names and Numbers"
- lpString$ = "" 'null string deletes existing value
- lpFileName$ = "ADIALER.INI"
- ListTotal% = TeleList.TeleListBox.ListCount 'gets number of entries in listbox
- 'Delete loop
- Dim I As Integer
- For I = 1 To ListTotal%
- lpKeyName$ = "Name" + Str$(I)
- WriteVar% = WritePrivateProfileString(lpAppName$, lpKeyName$, lpString$, lpFileName$)
- Next I
- End Sub
-
- Sub Dial ()
- CR$ = Chr$(13) + Chr$(10)
- 'Trim Name from List box string
- PhoneStr$ = Right$(PhoneNum$, 15)
- PhoneTrim$ = LTrim$(PhoneStr$)
- 'Open the Com Port
- OpenCom% = OpenComm(ComNo$, 128, 64)
- If OpenCom% < 0 Then
- MsgBox "Couldn't open Com Port" + CR$ + "Check configuration!!"
- Exit Sub
- End If
- 'Add prefix to number if checkbox checked
- If TeleList.PrefixCBox.Value = 1 Then
- PhoneTrim$ = TeleList.PrefixTxtBox.Text + "," + PhoneTrim$
- End If
- 'Dial the number
- dialstring$ = "ATDT" + PhoneTrim$ + CR$
- ModemWrite% = WriteComm(OpenCom%, dialstring$, 20)
- 'Pause loop
- For I = 1 To 200
- For I2 = 1 To 1000
- Next I2
- Next I
- MsgBox "Pick up the phone and press Enter"
- 'Turn off modem
- Break$ = "+++~~~ATH" + CR$
- ModemOff% = WriteComm(OpenCom%, Break$, 20)
- If CloseComm(1) < 0 Then
- MsgBox "Com port not closed"
- End If
- End Sub
-
- Function SetComPort (ComNo$)
- lpAppName$ = "ComPort"
- lpKeyName$ = "ComNo"
- nSize% = 5
- lpFileName$ = "ADIALER.INI"
- WriteVar% = WritePrivateProfileString(lpAppName$, lpKeyName$, ComNo$, lpFileName$)
- End Function
-
- Sub UpdateNamIni ()
- lpAppName$ = "Names and Numbers"
- lpFileName$ = "ADIALER.INI"
- 'Write new Names and Numbers from the listbox to ADIALER.INI
- NewListTotal% = TeleList.TeleListBox.ListCount
- 'Update loop
- Dim I2 As Integer
- For I = 1 To NewListTotal%
- I2 = I - 1 'corrects for listbox first entry as 0
- lpKeyName$ = "Name" + Str$(I)
- lpString$ = TeleList.TeleListBox.List(I2)
- WriteVar% = WritePrivateProfileString(lpAppName$, lpKeyName$, lpString$, lpFileName$)
- Next I
- End Sub
-
-